package com.hqq.behaviour.command;

/**
 * App
 * 客户（Client）角色：创建了一个具体命令(ConcreteCommand)对象并确定其接收者。
 * Created by heqianqian on 2017/6/15.
 */
public class App {

    public static void main(String[] args) {
        Wizard wizard = new Wizard();
        Goblin goblin = new Goblin();

        goblin.printStatus();

        wizard.castSpell(new ShrinkSpell(),goblin);
        goblin.printStatus();

        wizard.castSpell(new InvisibilitySpell(),goblin);
        goblin.printStatus();

        wizard.undoLastSpell();

        wizard.undoLastSpell();

        wizard.redoLastSpell();

        wizard.redoLastSpell();
    }
}
